/*----------------------------------------------------------
* FILE: EdSugeridaCorreoDet.java
* LOGICAL NAME: EdSugeridaCorreoDet
* PRODUCT: jsiit-model
*----------------------------------------------------------
* IMPORTANT NOTICE
* This program is property of DAI ( Development Alternatives Inc )
* Its unauthorized use, as any code alteration without authorization 
* is prohibited
*----------------------------------------------------------
* MODIFICATIONS
* DATE 12/07/2010
* AUTHOR nalopez
*----------------------------------------------------------
*/

package sv.gob.mh.dgii.model;

import java.io.Serializable;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author TPAR
 * <b>Created by </b>nalopez
 * <b>for</b>jsiit-model
 * <b>on</b> 12/07/2010 15:00:04
 * <b>Purpose</b> 
 * <p>
 * </p>
 */

@Entity
@Table(name = "ED_SUGERIDA_CORREO_DET", schema = "EDADEPUDOC")
public class EdSugeridaCorreoDet implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8524879994093194311L;
	
	private EdSugeridaCorreoDetId id;
	private Long cdeclaracion;
	private String mestado;
	private EdSugeridaCorreo edSugeridaCorreo;
	private String nit;

	/**
	 * 
	 */
	public EdSugeridaCorreoDet() {
	}
	
	public EdSugeridaCorreoDet(EdSugeridaCorreoDetId id) {
		this.id = id;
	}
	
	public EdSugeridaCorreoDet(EdSugeridaCorreoDetId id, Long cdeclaracion, String mestado, EdSugeridaCorreo edSugeridaCorreo, String nit) {
		this.id = id;
		this.cdeclaracion = cdeclaracion;
		this.mestado = mestado;
		this.edSugeridaCorreo = edSugeridaCorreo;
		this.nit = nit;
	}

	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "isugeridaCorreo", column = @Column(name = "I_SUGERIDA_CORREO", nullable = false, length = 12)),
			@AttributeOverride(name = "icorrelativo", column = @Column(name = "I_CORRELATIVO", nullable = false, length = 12)) })
	public EdSugeridaCorreoDetId getId() {
		return id;
	}

	public void setId(EdSugeridaCorreoDetId id) {
		this.id = id;
	}

	@Column(name = "C_DECLARACION", nullable = false, precision = 18, scale = 0)	
	public Long getCdeclaracion() {
		return cdeclaracion;
	}

	public void setCdeclaracion(Long cdeclaracion) {
		this.cdeclaracion = cdeclaracion;
	}

	@Column(name = "M_ESTADO", nullable = true, length = 1)
	public String getMestado() {
		return mestado;
	}

	public void setMestado(String mestado) {
		this.mestado = mestado;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "I_SUGERIDA_CORREO", unique = false, nullable = false, insertable = false, updatable = false)
	public EdSugeridaCorreo getEdSugeridaCorreo() {
		return edSugeridaCorreo;
	}

	public void setEdSugeridaCorreo(EdSugeridaCorreo edSugeridaCorreo) {
		this.edSugeridaCorreo = edSugeridaCorreo;
	}

	@Column(name = "NIT", nullable = true, length = 14)
	public String getNit() {
		return nit;
	}

	public void setNit(String nit) {
		this.nit = nit;
	}

}
